using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace HX.Model.Xcode.HXDB
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [BindTable("HX_PresidentMailbox_Access", Description = "", ConnName = "HXDB", DbType = DatabaseType.SqlServer)]
    public partial class HxPresidentmailboxAccess : IHxPresidentmailboxAccess
    {
        #region 属性
        private Int32 _ID;
        /// <summary></summary>
        [DisplayName("ID")]
        [DataObjectField(true, true, false, 10)]
        [BindColumn("ID", "", "int")]
        public Int32 ID { get => _ID; set { if (OnPropertyChanging(__.ID, value)) { _ID = value; OnPropertyChanged(__.ID); } } }

        private String _Account;
        /// <summary></summary>
        [DisplayName("Account")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn("Account", "", "varchar(50)")]
        public String Account { get => _Account; set { if (OnPropertyChanging(__.Account, value)) { _Account = value; OnPropertyChanged(__.Account); } } }

        private String _Keyword;
        /// <summary></summary>
        [DisplayName("Keyword")]
        [DataObjectField(false, false, true, 100)]
        [BindColumn("Keyword", "", "varchar(100)")]
        public String Keyword { get => _Keyword; set { if (OnPropertyChanging(__.Keyword, value)) { _Keyword = value; OnPropertyChanged(__.Keyword); } } }

        private DateTime _CreateAt;
        /// <summary></summary>
        [DisplayName("CreateAt")]
        [DataObjectField(false, false, true, 3)]
        [BindColumn("CreateAt", "", "datetime", Precision = 0, Scale = 3)]
        public DateTime CreateAt { get => _CreateAt; set { if (OnPropertyChanging(__.CreateAt, value)) { _CreateAt = value; OnPropertyChanged(__.CreateAt); } } }

        private Int32 _TaskId;
        /// <summary></summary>
        [DisplayName("TaskId")]
        [DataObjectField(false, false, true, 10)]
        [BindColumn("TaskId", "", "int")]
        public Int32 TaskId { get => _TaskId; set { if (OnPropertyChanging(__.TaskId, value)) { _TaskId = value; OnPropertyChanged(__.TaskId); } } }

        private String _Message;
        /// <summary></summary>
        [DisplayName("Message")]
        [DataObjectField(false, false, true, 500)]
        [BindColumn("Message", "", "varchar(500)")]
        public String Message { get => _Message; set { if (OnPropertyChanging(__.Message, value)) { _Message = value; OnPropertyChanged(__.Message); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.ID: return _ID;
                    case __.Account: return _Account;
                    case __.Keyword: return _Keyword;
                    case __.CreateAt: return _CreateAt;
                    case __.TaskId: return _TaskId;
                    case __.Message: return _Message;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.ID: _ID = value.ToInt(); break;
                    case __.Account: _Account = Convert.ToString(value); break;
                    case __.Keyword: _Keyword = Convert.ToString(value); break;
                    case __.CreateAt: _CreateAt = value.ToDateTime(); break;
                    case __.TaskId: _TaskId = value.ToInt(); break;
                    case __.Message: _Message = Convert.ToString(value); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得HxPresidentmailboxAccess字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary></summary>
            public static readonly Field ID = FindByName(__.ID);

            /// <summary></summary>
            public static readonly Field Account = FindByName(__.Account);

            /// <summary></summary>
            public static readonly Field Keyword = FindByName(__.Keyword);

            /// <summary></summary>
            public static readonly Field CreateAt = FindByName(__.CreateAt);

            /// <summary></summary>
            public static readonly Field TaskId = FindByName(__.TaskId);

            /// <summary></summary>
            public static readonly Field Message = FindByName(__.Message);

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得HxPresidentmailboxAccess字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary></summary>
            public const String ID = "ID";

            /// <summary></summary>
            public const String Account = "Account";

            /// <summary></summary>
            public const String Keyword = "Keyword";

            /// <summary></summary>
            public const String CreateAt = "CreateAt";

            /// <summary></summary>
            public const String TaskId = "TaskId";

            /// <summary></summary>
            public const String Message = "Message";
        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface IHxPresidentmailboxAccess
    {
        #region 属性
        /// <summary></summary>
        Int32 ID { get; set; }

        /// <summary></summary>
        String Account { get; set; }

        /// <summary></summary>
        String Keyword { get; set; }

        /// <summary></summary>
        DateTime CreateAt { get; set; }

        /// <summary></summary>
        Int32 TaskId { get; set; }

        /// <summary></summary>
        String Message { get; set; }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}